/*
 * BatallaNavalView.java
 */
package batallanaval;

import org.jdesktop.application.Action;
import org.jdesktop.application.ResourceMap;
import org.jdesktop.application.SingleFrameApplication;
import org.jdesktop.application.FrameView;
import org.jdesktop.application.TaskMonitor;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import javax.swing.Timer;
import javax.swing.Icon;
import javax.swing.ImageIcon;
import javax.swing.JDialog;
import javax.swing.JFrame;
import javax.swing.JOptionPane;

/**
 * The application's main frame.
 */
public class BatallaNavalView extends FrameView {

    int b1 = 0, b2 = 0, b3 = 0, b4 = 0, b5 = 0, b6 = 0, b7 = 0, b8 = 0, b9 = 0, b10 = 0;
    int b11 = 0, b12 = 0, b13 = 0, b14 = 0, b15 = 0, b16 = 0, b17 = 0, b18 = 0, b19 = 0, b20 = 0;
    int b21 = 0, b22 = 0, b23 = 0, b24 = 0, b25 = 0, sum = 0;
    char Estado = 'I';
    int largo = 5;
    int nbarcos = 2;
    int Jugador = 0;
    static Icon imgs[] = {
        new ImageIcon("Azul.gif"),
        new ImageIcon("Rojo.gif"),
        new ImageIcon("Negro.gif")
    };
    int matriz[][] = new int[largo][largo];
    Conexion c = new Conexion(new DriverRedSerial());
    String direc = "pc02";

    public BatallaNavalView(SingleFrameApplication app) {
        super(app);

        initComponents();
        for (int i = 0; i < largo; i++) {
            for (int j = 0; j < largo; j++) {
                matriz[i][j] = 0;
            }
        }

        // status bar initialization - message timeout, idle icon and busy animation, etc
        ResourceMap resourceMap = getResourceMap();
        int messageTimeout = resourceMap.getInteger("StatusBar.messageTimeout");
        messageTimer = new Timer(messageTimeout, new ActionListener() {

            public void actionPerformed(ActionEvent e) {
                statusMessageLabel.setText("");
            }
        });
        messageTimer.setRepeats(false);
        int busyAnimationRate = resourceMap.getInteger("StatusBar.busyAnimationRate");
        for (int i = 0; i < busyIcons.length; i++) {
            busyIcons[i] = resourceMap.getIcon("StatusBar.busyIcons[" + i + "]");
        }
        busyIconTimer = new Timer(busyAnimationRate, new ActionListener() {

            public void actionPerformed(ActionEvent e) {
                busyIconIndex = (busyIconIndex + 1) % busyIcons.length;
                statusAnimationLabel.setIcon(busyIcons[busyIconIndex]);
            }
        });
        idleIcon = resourceMap.getIcon("StatusBar.idleIcon");
        statusAnimationLabel.setIcon(idleIcon);
        progressBar.setVisible(false);

        // connecting action tasks to status bar via TaskMonitor
        TaskMonitor taskMonitor = new TaskMonitor(getApplication().getContext());
        taskMonitor.addPropertyChangeListener(new java.beans.PropertyChangeListener() {

            public void propertyChange(java.beans.PropertyChangeEvent evt) {
                String propertyName = evt.getPropertyName();
                if ("started".equals(propertyName)) {
                    if (!busyIconTimer.isRunning()) {
                        statusAnimationLabel.setIcon(busyIcons[0]);
                        busyIconIndex = 0;
                        busyIconTimer.start();
                    }
                    progressBar.setVisible(true);
                    progressBar.setIndeterminate(true);
                } else if ("done".equals(propertyName)) {
                    busyIconTimer.stop();
                    statusAnimationLabel.setIcon(idleIcon);
                    progressBar.setVisible(false);
                    progressBar.setValue(0);
                } else if ("message".equals(propertyName)) {
                    String text = (String) (evt.getNewValue());
                    statusMessageLabel.setText((text == null) ? "" : text);
                    messageTimer.restart();
                } else if ("progress".equals(propertyName)) {
                    int value = (Integer) (evt.getNewValue());
                    progressBar.setVisible(true);
                    progressBar.setIndeterminate(false);
                    progressBar.setValue(value);
                }
            }
        });
    }

    @Action
    public void showAboutBox() {
        if (aboutBox == null) {
            JFrame mainFrame = BatallaNavalApp.getApplication().getMainFrame();
            aboutBox = new BatallaNavalAboutBox(mainFrame);
            aboutBox.setLocationRelativeTo(mainFrame);
        }
        BatallaNavalApp.getApplication().show(aboutBox);
    }

    /** This method is called from within the constructor to
     * initialize the form.
     * WARNING: Do NOT modify this code. The content of this method is
     * always regenerated by the Form Editor.
     */
    @SuppressWarnings("unchecked")
    // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
    private void initComponents() {

        mainPanel = new javax.swing.JPanel();
        jPanel1 = new javax.swing.JPanel();
        jButton21 = new javax.swing.JButton();
        jButton22 = new javax.swing.JButton();
        jButton23 = new javax.swing.JButton();
        jButton24 = new javax.swing.JButton();
        jButton25 = new javax.swing.JButton();
        jButton16 = new javax.swing.JButton();
        jButton17 = new javax.swing.JButton();
        jButton18 = new javax.swing.JButton();
        jButton19 = new javax.swing.JButton();
        jButton20 = new javax.swing.JButton();
        jButton11 = new javax.swing.JButton();
        jButton12 = new javax.swing.JButton();
        jButton13 = new javax.swing.JButton();
        jButton14 = new javax.swing.JButton();
        jButton15 = new javax.swing.JButton();
        jButton1 = new javax.swing.JButton();
        jButton2 = new javax.swing.JButton();
        jButton3 = new javax.swing.JButton();
        jButton4 = new javax.swing.JButton();
        jButton5 = new javax.swing.JButton();
        jButton6 = new javax.swing.JButton();
        jButton7 = new javax.swing.JButton();
        jButton8 = new javax.swing.JButton();
        jButton9 = new javax.swing.JButton();
        jButton10 = new javax.swing.JButton();
        jPanel2 = new javax.swing.JPanel();
        jButton26 = new javax.swing.JButton();
        jButton27 = new javax.swing.JButton();
        jButton28 = new javax.swing.JButton();
        jButton29 = new javax.swing.JButton();
        jButton30 = new javax.swing.JButton();
        jButton31 = new javax.swing.JButton();
        jButton32 = new javax.swing.JButton();
        jButton33 = new javax.swing.JButton();
        jButton34 = new javax.swing.JButton();
        jButton35 = new javax.swing.JButton();
        jButton36 = new javax.swing.JButton();
        jButton37 = new javax.swing.JButton();
        jButton38 = new javax.swing.JButton();
        jButton39 = new javax.swing.JButton();
        jButton40 = new javax.swing.JButton();
        jButton41 = new javax.swing.JButton();
        jButton42 = new javax.swing.JButton();
        jButton43 = new javax.swing.JButton();
        jButton44 = new javax.swing.JButton();
        jButton45 = new javax.swing.JButton();
        jButton46 = new javax.swing.JButton();
        jButton47 = new javax.swing.JButton();
        jButton48 = new javax.swing.JButton();
        jButton49 = new javax.swing.JButton();
        jButton50 = new javax.swing.JButton();
        jButton51 = new javax.swing.JButton();
        jLabel1 = new javax.swing.JLabel();
        menuBar = new javax.swing.JMenuBar();
        javax.swing.JMenu fileMenu = new javax.swing.JMenu();
        javax.swing.JMenuItem exitMenuItem = new javax.swing.JMenuItem();
        javax.swing.JMenu helpMenu = new javax.swing.JMenu();
        javax.swing.JMenuItem aboutMenuItem = new javax.swing.JMenuItem();
        statusPanel = new javax.swing.JPanel();
        javax.swing.JSeparator statusPanelSeparator = new javax.swing.JSeparator();
        statusMessageLabel = new javax.swing.JLabel();
        statusAnimationLabel = new javax.swing.JLabel();
        progressBar = new javax.swing.JProgressBar();

        mainPanel.setAlignmentX(0.0F);
        mainPanel.setAlignmentY(0.0F);
        mainPanel.setName("mainPanel"); // NOI18N

        org.jdesktop.application.ResourceMap resourceMap = org.jdesktop.application.Application.getInstance(batallanaval.BatallaNavalApp.class).getContext().getResourceMap(BatallaNavalView.class);
        jPanel1.setBackground(resourceMap.getColor("jPanel1.background")); // NOI18N
        jPanel1.setBorder(javax.swing.BorderFactory.createTitledBorder(resourceMap.getString("jPanel1.border.title"))); // NOI18N
        jPanel1.setName("jPanel1"); // NOI18N

        jButton21.setBackground(resourceMap.getColor("jButton21.background")); // NOI18N
        jButton21.setIcon(resourceMap.getIcon("jButton21.icon")); // NOI18N
        jButton21.setAlignmentY(0.0F);
        jButton21.setName("jButton21"); // NOI18N
        jButton21.addMouseListener(new java.awt.event.MouseAdapter() {
            public void mouseClicked(java.awt.event.MouseEvent evt) {
                jButton21MouseClicked(evt);
            }
        });

        jButton22.setBackground(resourceMap.getColor("jButton21.background")); // NOI18N
        jButton22.setIcon(resourceMap.getIcon("jButton21.icon")); // NOI18N
        jButton22.setAlignmentY(0.0F);
        jButton22.setName("jButton22"); // NOI18N
        jButton22.addMouseListener(new java.awt.event.MouseAdapter() {
            public void mouseClicked(java.awt.event.MouseEvent evt) {
                jButton22MouseClicked(evt);
            }
        });

        jButton23.setBackground(resourceMap.getColor("jButton21.background")); // NOI18N
        jButton23.setIcon(resourceMap.getIcon("jButton21.icon")); // NOI18N
        jButton23.setAlignmentY(0.0F);
        jButton23.setName("jButton23"); // NOI18N
        jButton23.addMouseListener(new java.awt.event.MouseAdapter() {
            public void mouseClicked(java.awt.event.MouseEvent evt) {
                jButton23MouseClicked(evt);
            }
        });

        jButton24.setBackground(resourceMap.getColor("jButton21.background")); // NOI18N
        jButton24.setIcon(resourceMap.getIcon("jButton21.icon")); // NOI18N
        jButton24.setAlignmentY(0.0F);
        jButton24.setName("jButton24"); // NOI18N
        jButton24.addMouseListener(new java.awt.event.MouseAdapter() {
            public void mouseClicked(java.awt.event.MouseEvent evt) {
                jButton24MouseClicked(evt);
            }
        });

        jButton25.setBackground(resourceMap.getColor("jButton21.background")); // NOI18N
        jButton25.setIcon(resourceMap.getIcon("jButton21.icon")); // NOI18N
        jButton25.setAlignmentY(0.0F);
        jButton25.setName("jButton25"); // NOI18N
        jButton25.addMouseListener(new java.awt.event.MouseAdapter() {
            public void mouseClicked(java.awt.event.MouseEvent evt) {
                jButton25MouseClicked(evt);
            }
        });

        jButton16.setBackground(resourceMap.getColor("jButton21.background")); // NOI18N
        jButton16.setIcon(resourceMap.getIcon("jButton21.icon")); // NOI18N
        jButton16.setAlignmentY(0.0F);
        jButton16.setName("jButton16"); // NOI18N
        jButton16.addMouseListener(new java.awt.event.MouseAdapter() {
            public void mouseClicked(java.awt.event.MouseEvent evt) {
                jButton16MouseClicked(evt);
            }
        });

        jButton17.setBackground(resourceMap.getColor("jButton21.background")); // NOI18N
        jButton17.setIcon(resourceMap.getIcon("jButton21.icon")); // NOI18N
        jButton17.setAlignmentY(0.0F);
        jButton17.setName("jButton17"); // NOI18N
        jButton17.addMouseListener(new java.awt.event.MouseAdapter() {
            public void mouseClicked(java.awt.event.MouseEvent evt) {
                jButton17MouseClicked(evt);
            }
        });

        jButton18.setBackground(resourceMap.getColor("jButton21.background")); // NOI18N
        jButton18.setIcon(resourceMap.getIcon("jButton21.icon")); // NOI18N
        jButton18.setAlignmentY(0.0F);
        jButton18.setName("jButton18"); // NOI18N
        jButton18.addMouseListener(new java.awt.event.MouseAdapter() {
            public void mouseClicked(java.awt.event.MouseEvent evt) {
                jButton18MouseClicked(evt);
            }
        });

        jButton19.setBackground(resourceMap.getColor("jButton21.background")); // NOI18N
        jButton19.setIcon(resourceMap.getIcon("jButton21.icon")); // NOI18N
        jButton19.setAlignmentY(0.0F);
        jButton19.setName("jButton19"); // NOI18N
        jButton19.addMouseListener(new java.awt.event.MouseAdapter() {
            public void mouseClicked(java.awt.event.MouseEvent evt) {
                jButton19MouseClicked(evt);
            }
        });

        jButton20.setBackground(resourceMap.getColor("jButton21.background")); // NOI18N
        jButton20.setIcon(resourceMap.getIcon("jButton21.icon")); // NOI18N
        jButton20.setAlignmentY(0.0F);
        jButton20.setName("jButton20"); // NOI18N
        jButton20.addMouseListener(new java.awt.event.MouseAdapter() {
            public void mouseClicked(java.awt.event.MouseEvent evt) {
                jButton20MouseClicked(evt);
            }
        });

        jButton11.setBackground(resourceMap.getColor("jButton21.background")); // NOI18N
        jButton11.setIcon(resourceMap.getIcon("jButton21.icon")); // NOI18N
        jButton11.setAlignmentY(0.0F);
        jButton11.setName("jButton11"); // NOI18N
        jButton11.addMouseListener(new java.awt.event.MouseAdapter() {
            public void mouseClicked(java.awt.event.MouseEvent evt) {
                jButton11MouseClicked(evt);
            }
        });

        jButton12.setBackground(resourceMap.getColor("jButton21.background")); // NOI18N
        jButton12.setIcon(resourceMap.getIcon("jButton21.icon")); // NOI18N
        jButton12.setAlignmentY(0.0F);
        jButton12.setName("jButton12"); // NOI18N
        jButton12.addMouseListener(new java.awt.event.MouseAdapter() {
            public void mouseClicked(java.awt.event.MouseEvent evt) {
                jButton12MouseClicked(evt);
            }
        });

        jButton13.setBackground(resourceMap.getColor("jButton21.background")); // NOI18N
        jButton13.setIcon(resourceMap.getIcon("jButton21.icon")); // NOI18N
        jButton13.setAlignmentY(0.0F);
        jButton13.setName("jButton13"); // NOI18N
        jButton13.addMouseListener(new java.awt.event.MouseAdapter() {
            public void mouseClicked(java.awt.event.MouseEvent evt) {
                jButton13MouseClicked(evt);
            }
        });

        jButton14.setBackground(resourceMap.getColor("jButton21.background")); // NOI18N
        jButton14.setIcon(resourceMap.getIcon("jButton21.icon")); // NOI18N
        jButton14.setAlignmentY(0.0F);
        jButton14.setName("jButton14"); // NOI18N
        jButton14.addMouseListener(new java.awt.event.MouseAdapter() {
            public void mouseClicked(java.awt.event.MouseEvent evt) {
                jButton14MouseClicked(evt);
            }
        });

        jButton15.setBackground(resourceMap.getColor("jButton21.background")); // NOI18N
        jButton15.setIcon(resourceMap.getIcon("jButton21.icon")); // NOI18N
        jButton15.setAlignmentY(0.0F);
        jButton15.setName("jButton15"); // NOI18N
        jButton15.addMouseListener(new java.awt.event.MouseAdapter() {
            public void mouseClicked(java.awt.event.MouseEvent evt) {
                jButton15MouseClicked(evt);
            }
        });

        jButton1.setBackground(resourceMap.getColor("jButton21.background")); // NOI18N
        jButton1.setIcon(resourceMap.getIcon("jButton21.icon")); // NOI18N
        jButton1.setText(resourceMap.getString("jButton1.text")); // NOI18N
        jButton1.setAlignmentY(0.0F);
        jButton1.setName("jButton1"); // NOI18N
        jButton1.addMouseListener(new java.awt.event.MouseAdapter() {
            public void mouseClicked(java.awt.event.MouseEvent evt) {
                jButton1MouseClicked(evt);
            }
        });

        jButton2.setBackground(resourceMap.getColor("jButton21.background")); // NOI18N
        jButton2.setIcon(resourceMap.getIcon("jButton21.icon")); // NOI18N
        jButton2.setAlignmentY(0.0F);
        jButton2.setName("jButton2"); // NOI18N
        jButton2.addMouseListener(new java.awt.event.MouseAdapter() {
            public void mouseClicked(java.awt.event.MouseEvent evt) {
                jButton2MouseClicked(evt);
            }
        });

        jButton3.setBackground(resourceMap.getColor("jButton21.background")); // NOI18N
        jButton3.setIcon(resourceMap.getIcon("jButton21.icon")); // NOI18N
        jButton3.setAlignmentY(0.0F);
        jButton3.setName("jButton3"); // NOI18N
        jButton3.addMouseListener(new java.awt.event.MouseAdapter() {
            public void mouseClicked(java.awt.event.MouseEvent evt) {
                jButton3MouseClicked(evt);
            }
        });

        jButton4.setBackground(resourceMap.getColor("jButton21.background")); // NOI18N
        jButton4.setIcon(resourceMap.getIcon("jButton21.icon")); // NOI18N
        jButton4.setAlignmentY(0.0F);
        jButton4.setName("jButton4"); // NOI18N
        jButton4.addMouseListener(new java.awt.event.MouseAdapter() {
            public void mouseClicked(java.awt.event.MouseEvent evt) {
                jButton4MouseClicked(evt);
            }
        });

        jButton5.setBackground(resourceMap.getColor("jButton21.background")); // NOI18N
        jButton5.setIcon(resourceMap.getIcon("jButton21.icon")); // NOI18N
        jButton5.setAlignmentY(0.0F);
        jButton5.setName("jButton5"); // NOI18N
        jButton5.addMouseListener(new java.awt.event.MouseAdapter() {
            public void mouseClicked(java.awt.event.MouseEvent evt) {
                jButton5MouseClicked(evt);
            }
        });

        jButton6.setBackground(resourceMap.getColor("jButton21.background")); // NOI18N
        jButton6.setIcon(resourceMap.getIcon("jButton21.icon")); // NOI18N
        jButton6.setAlignmentY(0.0F);
        jButton6.setName("jButton6"); // NOI18N
        jButton6.addMouseListener(new java.awt.event.MouseAdapter() {
            public void mouseClicked(java.awt.event.MouseEvent evt) {
                jButton6MouseClicked(evt);
            }
        });

        jButton7.setBackground(resourceMap.getColor("jButton21.background")); // NOI18N
        jButton7.setIcon(resourceMap.getIcon("jButton21.icon")); // NOI18N
        jButton7.setAlignmentY(0.0F);
        jButton7.setName("jButton7"); // NOI18N
        jButton7.addMouseListener(new java.awt.event.MouseAdapter() {
            public void mouseClicked(java.awt.event.MouseEvent evt) {
                jButton7MouseClicked(evt);
            }
        });

        jButton8.setBackground(resourceMap.getColor("jButton21.background")); // NOI18N
        jButton8.setIcon(resourceMap.getIcon("jButton21.icon")); // NOI18N
        jButton8.setAlignmentY(0.0F);
        jButton8.setName("jButton8"); // NOI18N
        jButton8.addMouseListener(new java.awt.event.MouseAdapter() {
            public void mouseClicked(java.awt.event.MouseEvent evt) {
                jButton8MouseClicked(evt);
            }
        });

        jButton9.setBackground(resourceMap.getColor("jButton21.background")); // NOI18N
        jButton9.setIcon(resourceMap.getIcon("jButton21.icon")); // NOI18N
        jButton9.setAlignmentY(0.0F);
        jButton9.setName("jButton9"); // NOI18N
        jButton9.addMouseListener(new java.awt.event.MouseAdapter() {
            public void mouseClicked(java.awt.event.MouseEvent evt) {
                jButton9MouseClicked(evt);
            }
        });

        jButton10.setBackground(resourceMap.getColor("jButton21.background")); // NOI18N
        jButton10.setIcon(resourceMap.getIcon("jButton21.icon")); // NOI18N
        jButton10.setAlignmentY(0.0F);
        jButton10.setName("jButton10"); // NOI18N
        jButton10.addMouseListener(new java.awt.event.MouseAdapter() {
            public void mouseClicked(java.awt.event.MouseEvent evt) {
                jButton10MouseClicked(evt);
            }
        });

        javax.swing.GroupLayout jPanel1Layout = new javax.swing.GroupLayout(jPanel1);
        jPanel1.setLayout(jPanel1Layout);
        jPanel1Layout.setHorizontalGroup(
            jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel1Layout.createSequentialGroup()
                .addContainerGap()
                .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(jPanel1Layout.createSequentialGroup()
                        .addComponent(jButton1, javax.swing.GroupLayout.PREFERRED_SIZE, 20, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addComponent(jButton2, javax.swing.GroupLayout.PREFERRED_SIZE, 20, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addComponent(jButton3, javax.swing.GroupLayout.PREFERRED_SIZE, 20, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addComponent(jButton4, javax.swing.GroupLayout.PREFERRED_SIZE, 20, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addComponent(jButton5, javax.swing.GroupLayout.PREFERRED_SIZE, 20, javax.swing.GroupLayout.PREFERRED_SIZE))
                    .addGroup(jPanel1Layout.createSequentialGroup()
                        .addComponent(jButton6, javax.swing.GroupLayout.PREFERRED_SIZE, 20, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addComponent(jButton7, javax.swing.GroupLayout.PREFERRED_SIZE, 20, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addComponent(jButton8, javax.swing.GroupLayout.PREFERRED_SIZE, 20, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addComponent(jButton9, javax.swing.GroupLayout.PREFERRED_SIZE, 20, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addComponent(jButton10, javax.swing.GroupLayout.PREFERRED_SIZE, 20, javax.swing.GroupLayout.PREFERRED_SIZE))
                    .addGroup(jPanel1Layout.createSequentialGroup()
                        .addComponent(jButton11, javax.swing.GroupLayout.PREFERRED_SIZE, 20, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addComponent(jButton12, javax.swing.GroupLayout.PREFERRED_SIZE, 20, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addComponent(jButton13, javax.swing.GroupLayout.PREFERRED_SIZE, 20, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addComponent(jButton14, javax.swing.GroupLayout.PREFERRED_SIZE, 20, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addComponent(jButton15, javax.swing.GroupLayout.PREFERRED_SIZE, 20, javax.swing.GroupLayout.PREFERRED_SIZE))
                    .addGroup(jPanel1Layout.createSequentialGroup()
                        .addComponent(jButton16, javax.swing.GroupLayout.PREFERRED_SIZE, 20, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addComponent(jButton17, javax.swing.GroupLayout.PREFERRED_SIZE, 20, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addComponent(jButton18, javax.swing.GroupLayout.PREFERRED_SIZE, 20, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addComponent(jButton19, javax.swing.GroupLayout.PREFERRED_SIZE, 20, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addComponent(jButton20, javax.swing.GroupLayout.PREFERRED_SIZE, 20, javax.swing.GroupLayout.PREFERRED_SIZE))
                    .addGroup(jPanel1Layout.createSequentialGroup()
                        .addComponent(jButton21, javax.swing.GroupLayout.PREFERRED_SIZE, 20, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addComponent(jButton22, javax.swing.GroupLayout.PREFERRED_SIZE, 20, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addComponent(jButton23, javax.swing.GroupLayout.PREFERRED_SIZE, 20, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addComponent(jButton24, javax.swing.GroupLayout.PREFERRED_SIZE, 20, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addComponent(jButton25, javax.swing.GroupLayout.PREFERRED_SIZE, 20, javax.swing.GroupLayout.PREFERRED_SIZE)))
                .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
        );

        jPanel1Layout.linkSize(javax.swing.SwingConstants.HORIZONTAL, new java.awt.Component[] {jButton1, jButton10, jButton2, jButton3, jButton4, jButton5, jButton6, jButton7, jButton8, jButton9});

        jPanel1Layout.setVerticalGroup(
            jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel1Layout.createSequentialGroup()
                .addContainerGap()
                .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(jButton5, javax.swing.GroupLayout.PREFERRED_SIZE, 20, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(jButton4, javax.swing.GroupLayout.PREFERRED_SIZE, 20, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(jButton3, javax.swing.GroupLayout.PREFERRED_SIZE, 20, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(jButton2, javax.swing.GroupLayout.PREFERRED_SIZE, 20, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(jButton1, javax.swing.GroupLayout.PREFERRED_SIZE, 20, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(jButton6, javax.swing.GroupLayout.PREFERRED_SIZE, 20, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(jButton7, javax.swing.GroupLayout.PREFERRED_SIZE, 20, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(jButton8, javax.swing.GroupLayout.PREFERRED_SIZE, 20, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(jButton9, javax.swing.GroupLayout.PREFERRED_SIZE, 20, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(jButton10, javax.swing.GroupLayout.PREFERRED_SIZE, 20, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(jButton11, javax.swing.GroupLayout.PREFERRED_SIZE, 20, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(jButton12, javax.swing.GroupLayout.PREFERRED_SIZE, 20, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(jButton13, javax.swing.GroupLayout.PREFERRED_SIZE, 20, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(jButton14, javax.swing.GroupLayout.PREFERRED_SIZE, 20, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(jButton15, javax.swing.GroupLayout.PREFERRED_SIZE, 20, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(jButton16, javax.swing.GroupLayout.PREFERRED_SIZE, 20, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(jButton17, javax.swing.GroupLayout.PREFERRED_SIZE, 20, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(jButton18, javax.swing.GroupLayout.PREFERRED_SIZE, 20, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(jButton19, javax.swing.GroupLayout.PREFERRED_SIZE, 20, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(jButton20, javax.swing.GroupLayout.PREFERRED_SIZE, 20, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(jButton21, javax.swing.GroupLayout.PREFERRED_SIZE, 20, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(jButton22, javax.swing.GroupLayout.PREFERRED_SIZE, 20, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(jButton23, javax.swing.GroupLayout.PREFERRED_SIZE, 20, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(jButton24, javax.swing.GroupLayout.PREFERRED_SIZE, 20, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(jButton25, javax.swing.GroupLayout.PREFERRED_SIZE, 20, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
        );

        jPanel1Layout.linkSize(javax.swing.SwingConstants.VERTICAL, new java.awt.Component[] {jButton1, jButton10, jButton2, jButton3, jButton4, jButton5, jButton6, jButton7, jButton8, jButton9});

        jPanel2.setBackground(resourceMap.getColor("jPanel2.background")); // NOI18N
        jPanel2.setBorder(javax.swing.BorderFactory.createTitledBorder(resourceMap.getString("jPanel2.border.title"))); // NOI18N
        jPanel2.setName("jPanel2"); // NOI18N

        jButton26.setBackground(resourceMap.getColor("jButton26.background")); // NOI18N
        jButton26.setIcon(resourceMap.getIcon("jButton26.icon")); // NOI18N
        jButton26.setAlignmentY(0.0F);
        jButton26.setName("jButton26"); // NOI18N
        jButton26.addMouseListener(new java.awt.event.MouseAdapter() {
            public void mouseClicked(java.awt.event.MouseEvent evt) {
                jButton26MouseClicked(evt);
            }
        });

        jButton27.setBackground(resourceMap.getColor("jButton27.background")); // NOI18N
        jButton27.setIcon(resourceMap.getIcon("jButton27.icon")); // NOI18N
        jButton27.setAlignmentY(0.0F);
        jButton27.setName("jButton27"); // NOI18N
        jButton27.addMouseListener(new java.awt.event.MouseAdapter() {
            public void mouseClicked(java.awt.event.MouseEvent evt) {
                jButton27MouseClicked(evt);
            }
        });

        jButton28.setBackground(resourceMap.getColor("jButton28.background")); // NOI18N
        jButton28.setIcon(resourceMap.getIcon("jButton28.icon")); // NOI18N
        jButton28.setAlignmentY(0.0F);
        jButton28.setName("jButton28"); // NOI18N
        jButton28.addMouseListener(new java.awt.event.MouseAdapter() {
            public void mouseClicked(java.awt.event.MouseEvent evt) {
                jButton28MouseClicked(evt);
            }
        });

        jButton29.setBackground(resourceMap.getColor("jButton29.background")); // NOI18N
        jButton29.setIcon(resourceMap.getIcon("jButton29.icon")); // NOI18N
        jButton29.setAlignmentY(0.0F);
        jButton29.setName("jButton29"); // NOI18N
        jButton29.addMouseListener(new java.awt.event.MouseAdapter() {
            public void mouseClicked(java.awt.event.MouseEvent evt) {
                jButton29MouseClicked(evt);
            }
        });

        jButton30.setBackground(resourceMap.getColor("jButton30.background")); // NOI18N
        jButton30.setIcon(resourceMap.getIcon("jButton30.icon")); // NOI18N
        jButton30.setAlignmentY(0.0F);
        jButton30.setName("jButton30"); // NOI18N
        jButton30.addMouseListener(new java.awt.event.MouseAdapter() {
            public void mouseClicked(java.awt.event.MouseEvent evt) {
                jButton30MouseClicked(evt);
            }
        });

        jButton31.setBackground(resourceMap.getColor("jButton31.background")); // NOI18N
        jButton31.setIcon(resourceMap.getIcon("jButton31.icon")); // NOI18N
        jButton31.setAlignmentY(0.0F);
        jButton31.setName("jButton31"); // NOI18N
        jButton31.addMouseListener(new java.awt.event.MouseAdapter() {
            public void mouseClicked(java.awt.event.MouseEvent evt) {
                jButton31MouseClicked(evt);
            }
        });

        jButton32.setBackground(resourceMap.getColor("jButton32.background")); // NOI18N
        jButton32.setIcon(resourceMap.getIcon("jButton32.icon")); // NOI18N
        jButton32.setAlignmentY(0.0F);
        jButton32.setName("jButton32"); // NOI18N
        jButton32.addMouseListener(new java.awt.event.MouseAdapter() {
            public void mouseClicked(java.awt.event.MouseEvent evt) {
                jButton32MouseClicked(evt);
            }
        });

        jButton33.setBackground(resourceMap.getColor("jButton33.background")); // NOI18N
        jButton33.setIcon(resourceMap.getIcon("jButton33.icon")); // NOI18N
        jButton33.setAlignmentY(0.0F);
        jButton33.setName("jButton33"); // NOI18N
        jButton33.addMouseListener(new java.awt.event.MouseAdapter() {
            public void mouseClicked(java.awt.event.MouseEvent evt) {
                jButton33MouseClicked(evt);
            }
        });

        jButton34.setBackground(resourceMap.getColor("jButton34.background")); // NOI18N
        jButton34.setIcon(resourceMap.getIcon("jButton34.icon")); // NOI18N
        jButton34.setAlignmentY(0.0F);
        jButton34.setName("jButton34"); // NOI18N
        jButton34.addMouseListener(new java.awt.event.MouseAdapter() {
            public void mouseClicked(java.awt.event.MouseEvent evt) {
                jButton34MouseClicked(evt);
            }
        });

        jButton35.setBackground(resourceMap.getColor("jButton35.background")); // NOI18N
        jButton35.setIcon(resourceMap.getIcon("jButton35.icon")); // NOI18N
        jButton35.setAlignmentY(0.0F);
        jButton35.setName("jButton35"); // NOI18N
        jButton35.addMouseListener(new java.awt.event.MouseAdapter() {
            public void mouseClicked(java.awt.event.MouseEvent evt) {
                jButton35MouseClicked(evt);
            }
        });

        jButton36.setBackground(resourceMap.getColor("jButton36.background")); // NOI18N
        jButton36.setIcon(resourceMap.getIcon("jButton36.icon")); // NOI18N
        jButton36.setAlignmentY(0.0F);
        jButton36.setName("jButton36"); // NOI18N
        jButton36.addMouseListener(new java.awt.event.MouseAdapter() {
            public void mouseClicked(java.awt.event.MouseEvent evt) {
                jButton36MouseClicked(evt);
            }
        });

        jButton37.setBackground(resourceMap.getColor("jButton37.background")); // NOI18N
        jButton37.setIcon(resourceMap.getIcon("jButton37.icon")); // NOI18N
        jButton37.setAlignmentY(0.0F);
        jButton37.setName("jButton37"); // NOI18N
        jButton37.addMouseListener(new java.awt.event.MouseAdapter() {
            public void mouseClicked(java.awt.event.MouseEvent evt) {
                jButton37MouseClicked(evt);
            }
        });

        jButton38.setBackground(resourceMap.getColor("jButton38.background")); // NOI18N
        jButton38.setIcon(resourceMap.getIcon("jButton38.icon")); // NOI18N
        jButton38.setAlignmentY(0.0F);
        jButton38.setName("jButton38"); // NOI18N
        jButton38.addMouseListener(new java.awt.event.MouseAdapter() {
            public void mouseClicked(java.awt.event.MouseEvent evt) {
                jButton38MouseClicked(evt);
            }
        });

        jButton39.setBackground(resourceMap.getColor("jButton39.background")); // NOI18N
        jButton39.setIcon(resourceMap.getIcon("jButton39.icon")); // NOI18N
        jButton39.setAlignmentY(0.0F);
        jButton39.setName("jButton39"); // NOI18N
        jButton39.addMouseListener(new java.awt.event.MouseAdapter() {
            public void mouseClicked(java.awt.event.MouseEvent evt) {
                jButton39MouseClicked(evt);
            }
        });

        jButton40.setBackground(resourceMap.getColor("jButton40.background")); // NOI18N
        jButton40.setIcon(resourceMap.getIcon("jButton40.icon")); // NOI18N
        jButton40.setAlignmentY(0.0F);
        jButton40.setName("jButton40"); // NOI18N
        jButton40.addMouseListener(new java.awt.event.MouseAdapter() {
            public void mouseClicked(java.awt.event.MouseEvent evt) {
                jButton40MouseClicked(evt);
            }
        });

        jButton41.setBackground(resourceMap.getColor("jButton41.background")); // NOI18N
        jButton41.setIcon(resourceMap.getIcon("jButton41.icon")); // NOI18N
        jButton41.setAlignmentY(0.0F);
        jButton41.setName("jButton41"); // NOI18N
        jButton41.addMouseListener(new java.awt.event.MouseAdapter() {
            public void mouseClicked(java.awt.event.MouseEvent evt) {
                jButton41MouseClicked(evt);
            }
        });

        jButton42.setBackground(resourceMap.getColor("jButton42.background")); // NOI18N
        jButton42.setIcon(resourceMap.getIcon("jButton42.icon")); // NOI18N
        jButton42.setAlignmentY(0.0F);
        jButton42.setName("jButton42"); // NOI18N
        jButton42.addMouseListener(new java.awt.event.MouseAdapter() {
            public void mouseClicked(java.awt.event.MouseEvent evt) {
                jButton42MouseClicked(evt);
            }
        });

        jButton43.setBackground(resourceMap.getColor("jButton43.background")); // NOI18N
        jButton43.setIcon(resourceMap.getIcon("jButton43.icon")); // NOI18N
        jButton43.setAlignmentY(0.0F);
        jButton43.setName("jButton43"); // NOI18N
        jButton43.addMouseListener(new java.awt.event.MouseAdapter() {
            public void mouseClicked(java.awt.event.MouseEvent evt) {
                jButton43MouseClicked(evt);
            }
        });

        jButton44.setBackground(resourceMap.getColor("jButton44.background")); // NOI18N
        jButton44.setIcon(resourceMap.getIcon("jButton44.icon")); // NOI18N
        jButton44.setAlignmentY(0.0F);
        jButton44.setName("jButton44"); // NOI18N
        jButton44.addMouseListener(new java.awt.event.MouseAdapter() {
            public void mouseClicked(java.awt.event.MouseEvent evt) {
                jButton44MouseClicked(evt);
            }
        });

        jButton45.setBackground(resourceMap.getColor("jButton45.background")); // NOI18N
        jButton45.setIcon(resourceMap.getIcon("jButton45.icon")); // NOI18N
        jButton45.setAlignmentY(0.0F);
        jButton45.setName("jButton45"); // NOI18N
        jButton45.addMouseListener(new java.awt.event.MouseAdapter() {
            public void mouseClicked(java.awt.event.MouseEvent evt) {
                jButton45MouseClicked(evt);
            }
        });

        jButton46.setBackground(resourceMap.getColor("jButton46.background")); // NOI18N
        jButton46.setIcon(resourceMap.getIcon("jButton46.icon")); // NOI18N
        jButton46.setAlignmentY(0.0F);
        jButton46.setName("jButton46"); // NOI18N
        jButton46.addMouseListener(new java.awt.event.MouseAdapter() {
            public void mouseClicked(java.awt.event.MouseEvent evt) {
                jButton46MouseClicked(evt);
            }
        });

        jButton47.setBackground(resourceMap.getColor("jButton47.background")); // NOI18N
        jButton47.setIcon(resourceMap.getIcon("jButton47.icon")); // NOI18N
        jButton47.setAlignmentY(0.0F);
        jButton47.setName("jButton47"); // NOI18N
        jButton47.addMouseListener(new java.awt.event.MouseAdapter() {
            public void mouseClicked(java.awt.event.MouseEvent evt) {
                jButton47MouseClicked(evt);
            }
        });

        jButton48.setBackground(resourceMap.getColor("jButton48.background")); // NOI18N
        jButton48.setIcon(resourceMap.getIcon("jButton48.icon")); // NOI18N
        jButton48.setAlignmentY(0.0F);
        jButton48.setName("jButton48"); // NOI18N
        jButton48.addMouseListener(new java.awt.event.MouseAdapter() {
            public void mouseClicked(java.awt.event.MouseEvent evt) {
                jButton48MouseClicked(evt);
            }
        });

        jButton49.setBackground(resourceMap.getColor("jButton49.background")); // NOI18N
        jButton49.setIcon(resourceMap.getIcon("jButton49.icon")); // NOI18N
        jButton49.setAlignmentY(0.0F);
        jButton49.setName("jButton49"); // NOI18N
        jButton49.addMouseListener(new java.awt.event.MouseAdapter() {
            public void mouseClicked(java.awt.event.MouseEvent evt) {
                jButton49MouseClicked(evt);
            }
        });

        jButton50.setBackground(resourceMap.getColor("jButton50.background")); // NOI18N
        jButton50.setIcon(resourceMap.getIcon("jButton50.icon")); // NOI18N
        jButton50.setAlignmentY(0.0F);
        jButton50.setName("jButton50"); // NOI18N
        jButton50.addMouseListener(new java.awt.event.MouseAdapter() {
            public void mouseClicked(java.awt.event.MouseEvent evt) {
                jButton50MouseClicked(evt);
            }
        });

        javax.swing.GroupLayout jPanel2Layout = new javax.swing.GroupLayout(jPanel2);
        jPanel2.setLayout(jPanel2Layout);
        jPanel2Layout.setHorizontalGroup(
            jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel2Layout.createSequentialGroup()
                .addContainerGap()
                .addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(jPanel2Layout.createSequentialGroup()
                        .addComponent(jButton26, javax.swing.GroupLayout.PREFERRED_SIZE, 20, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addComponent(jButton27, javax.swing.GroupLayout.PREFERRED_SIZE, 20, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addComponent(jButton28, javax.swing.GroupLayout.PREFERRED_SIZE, 20, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addComponent(jButton29, javax.swing.GroupLayout.PREFERRED_SIZE, 20, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addComponent(jButton30, javax.swing.GroupLayout.PREFERRED_SIZE, 20, javax.swing.GroupLayout.PREFERRED_SIZE))
                    .addGroup(jPanel2Layout.createSequentialGroup()
                        .addComponent(jButton36, javax.swing.GroupLayout.PREFERRED_SIZE, 20, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addComponent(jButton37, javax.swing.GroupLayout.PREFERRED_SIZE, 20, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addComponent(jButton38, javax.swing.GroupLayout.PREFERRED_SIZE, 20, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addComponent(jButton39, javax.swing.GroupLayout.PREFERRED_SIZE, 20, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addComponent(jButton40, javax.swing.GroupLayout.PREFERRED_SIZE, 20, javax.swing.GroupLayout.PREFERRED_SIZE))
                    .addGroup(jPanel2Layout.createSequentialGroup()
                        .addComponent(jButton46, javax.swing.GroupLayout.PREFERRED_SIZE, 20, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addComponent(jButton47, javax.swing.GroupLayout.PREFERRED_SIZE, 20, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addComponent(jButton48, javax.swing.GroupLayout.PREFERRED_SIZE, 20, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addComponent(jButton49, javax.swing.GroupLayout.PREFERRED_SIZE, 20, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addComponent(jButton50, javax.swing.GroupLayout.PREFERRED_SIZE, 20, javax.swing.GroupLayout.PREFERRED_SIZE))
                    .addGroup(jPanel2Layout.createSequentialGroup()
                        .addComponent(jButton31, javax.swing.GroupLayout.PREFERRED_SIZE, 20, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addComponent(jButton32, javax.swing.GroupLayout.PREFERRED_SIZE, 20, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addComponent(jButton33, javax.swing.GroupLayout.PREFERRED_SIZE, 20, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addComponent(jButton34, javax.swing.GroupLayout.PREFERRED_SIZE, 20, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addComponent(jButton35, javax.swing.GroupLayout.PREFERRED_SIZE, 20, javax.swing.GroupLayout.PREFERRED_SIZE))
                    .addGroup(jPanel2Layout.createSequentialGroup()
                        .addComponent(jButton41, javax.swing.GroupLayout.PREFERRED_SIZE, 20, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addComponent(jButton42, javax.swing.GroupLayout.PREFERRED_SIZE, 20, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addComponent(jButton43, javax.swing.GroupLayout.PREFERRED_SIZE, 20, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addComponent(jButton44, javax.swing.GroupLayout.PREFERRED_SIZE, 20, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addComponent(jButton45, javax.swing.GroupLayout.PREFERRED_SIZE, 20, javax.swing.GroupLayout.PREFERRED_SIZE)))
                .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
        );
        jPanel2Layout.setVerticalGroup(
            jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel2Layout.createSequentialGroup()
                .addContainerGap()
                .addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(jButton26, javax.swing.GroupLayout.PREFERRED_SIZE, 20, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(jButton27, javax.swing.GroupLayout.PREFERRED_SIZE, 20, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(jButton28, javax.swing.GroupLayout.PREFERRED_SIZE, 20, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(jButton29, javax.swing.GroupLayout.PREFERRED_SIZE, 20, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(jButton30, javax.swing.GroupLayout.PREFERRED_SIZE, 20, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(jButton31, javax.swing.GroupLayout.PREFERRED_SIZE, 20, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(jButton32, javax.swing.GroupLayout.PREFERRED_SIZE, 20, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(jButton33, javax.swing.GroupLayout.PREFERRED_SIZE, 20, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(jButton34, javax.swing.GroupLayout.PREFERRED_SIZE, 20, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(jButton35, javax.swing.GroupLayout.PREFERRED_SIZE, 20, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(jButton36, javax.swing.GroupLayout.PREFERRED_SIZE, 20, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(jButton37, javax.swing.GroupLayout.PREFERRED_SIZE, 20, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(jButton38, javax.swing.GroupLayout.PREFERRED_SIZE, 20, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(jButton39, javax.swing.GroupLayout.PREFERRED_SIZE, 20, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(jButton40, javax.swing.GroupLayout.PREFERRED_SIZE, 20, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(jButton41, javax.swing.GroupLayout.PREFERRED_SIZE, 20, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(jButton42, javax.swing.GroupLayout.PREFERRED_SIZE, 20, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(jButton43, javax.swing.GroupLayout.PREFERRED_SIZE, 20, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(jButton44, javax.swing.GroupLayout.PREFERRED_SIZE, 20, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(jButton45, javax.swing.GroupLayout.PREFERRED_SIZE, 20, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
                    .addComponent(jButton46, javax.swing.GroupLayout.PREFERRED_SIZE, 20, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(jButton47, javax.swing.GroupLayout.PREFERRED_SIZE, 20, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(jButton48, javax.swing.GroupLayout.PREFERRED_SIZE, 20, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(jButton49, javax.swing.GroupLayout.PREFERRED_SIZE, 20, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(jButton50, javax.swing.GroupLayout.PREFERRED_SIZE, 20, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addGap(28, 28, 28))
        );

        jButton51.setText(resourceMap.getString("jButton51.text")); // NOI18N
        jButton51.setName("jButton51"); // NOI18N
        jButton51.addMouseListener(new java.awt.event.MouseAdapter() {
            public void mouseClicked(java.awt.event.MouseEvent evt) {
                jButton51MouseClicked(evt);
            }
        });

        jLabel1.setFont(resourceMap.getFont("jLabel1.font")); // NOI18N
        jLabel1.setText(resourceMap.getString("jLabel1.text")); // NOI18N
        jLabel1.setName("jLabel1"); // NOI18N

        javax.swing.GroupLayout mainPanelLayout = new javax.swing.GroupLayout(mainPanel);
        mainPanel.setLayout(mainPanelLayout);
        mainPanelLayout.setHorizontalGroup(
            mainPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(mainPanelLayout.createSequentialGroup()
                .addGroup(mainPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(mainPanelLayout.createSequentialGroup()
                        .addGap(32, 32, 32)
                        .addComponent(jPanel1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addGap(60, 60, 60)
                        .addComponent(jButton51)
                        .addGap(62, 62, 62)
                        .addComponent(jPanel2, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                    .addGroup(mainPanelLayout.createSequentialGroup()
                        .addGap(228, 228, 228)
                        .addComponent(jLabel1)))
                .addContainerGap(39, Short.MAX_VALUE))
        );
        mainPanelLayout.setVerticalGroup(
            mainPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(mainPanelLayout.createSequentialGroup()
                .addGap(21, 21, 21)
                .addComponent(jLabel1)
                .addGap(3, 3, 3)
                .addGroup(mainPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(mainPanelLayout.createSequentialGroup()
                        .addGap(22, 22, 22)
                        .addGroup(mainPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addComponent(jPanel2, javax.swing.GroupLayout.PREFERRED_SIZE, 173, javax.swing.GroupLayout.PREFERRED_SIZE)
                            .addComponent(jPanel1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)))
                    .addGroup(mainPanelLayout.createSequentialGroup()
                        .addGap(102, 102, 102)
                        .addComponent(jButton51)))
                .addContainerGap(54, Short.MAX_VALUE))
        );

        menuBar.setName("menuBar"); // NOI18N

        fileMenu.setText(resourceMap.getString("fileMenu.text")); // NOI18N
        fileMenu.setName("fileMenu"); // NOI18N

        javax.swing.ActionMap actionMap = org.jdesktop.application.Application.getInstance(batallanaval.BatallaNavalApp.class).getContext().getActionMap(BatallaNavalView.class, this);
        exitMenuItem.setAction(actionMap.get("quit")); // NOI18N
        exitMenuItem.setName("exitMenuItem"); // NOI18N
        fileMenu.add(exitMenuItem);

        menuBar.add(fileMenu);

        helpMenu.setText(resourceMap.getString("helpMenu.text")); // NOI18N
        helpMenu.setName("helpMenu"); // NOI18N

        aboutMenuItem.setAction(actionMap.get("showAboutBox")); // NOI18N
        aboutMenuItem.setName("aboutMenuItem"); // NOI18N
        helpMenu.add(aboutMenuItem);

        menuBar.add(helpMenu);

        statusPanel.setName("statusPanel"); // NOI18N

        statusPanelSeparator.setName("statusPanelSeparator"); // NOI18N

        statusMessageLabel.setName("statusMessageLabel"); // NOI18N

        statusAnimationLabel.setHorizontalAlignment(javax.swing.SwingConstants.LEFT);
        statusAnimationLabel.setName("statusAnimationLabel"); // NOI18N

        progressBar.setName("progressBar"); // NOI18N

        javax.swing.GroupLayout statusPanelLayout = new javax.swing.GroupLayout(statusPanel);
        statusPanel.setLayout(statusPanelLayout);
        statusPanelLayout.setHorizontalGroup(
            statusPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addComponent(statusPanelSeparator, javax.swing.GroupLayout.DEFAULT_SIZE, 566, Short.MAX_VALUE)
            .addGroup(statusPanelLayout.createSequentialGroup()
                .addContainerGap()
                .addComponent(statusMessageLabel)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 396, Short.MAX_VALUE)
                .addComponent(progressBar, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(statusAnimationLabel)
                .addContainerGap())
        );
        statusPanelLayout.setVerticalGroup(
            statusPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(statusPanelLayout.createSequentialGroup()
                .addComponent(statusPanelSeparator, javax.swing.GroupLayout.PREFERRED_SIZE, 2, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                .addGroup(statusPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(statusMessageLabel)
                    .addComponent(statusAnimationLabel)
                    .addComponent(progressBar, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addGap(3, 3, 3))
        );

        setComponent(mainPanel);
        setMenuBar(menuBar);
        setStatusBar(statusPanel);
    }// </editor-fold>//GEN-END:initComponents

    private void jButton1MouseClicked(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_jButton1MouseClicked
        if (Estado == 'I') {
            if (matriz[0][0] == 1) {
                jButton1.setIcon(imgs[0]);
                sum = sum - 1;
                matriz[0][0] = 0;
            } else {
                if (sum < nbarcos) {
                    if (matriz[0][0] == 0) {
                        jButton1.setIcon(imgs[2]);
                        sum = sum + 1;
                        matriz[0][0] = 1;
                    }
                }
            }// TODO add your handling code here:
        }
    }//GEN-LAST:event_jButton1MouseClicked

    private void jButton2MouseClicked(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_jButton2MouseClicked
        if (Estado == 'I') {
            if (matriz[0][1] == 1) {
                jButton2.setIcon(imgs[0]);
                sum = sum - 1;
                matriz[0][1] = 0;
            } else {
                if (sum < nbarcos) {
                    if (matriz[0][1] == 0) {
                        jButton2.setIcon(imgs[2]);
                        sum = sum + 1;
                        matriz[0][1] = 1;
                    }
                }
            }
        }
    }//GEN-LAST:event_jButton2MouseClicked

    private void jButton3MouseClicked(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_jButton3MouseClicked
        if (Estado == 'I') {
            if (matriz[0][2] == 1) {
                jButton3.setIcon(imgs[0]);
                sum = sum - 1;
                matriz[0][2] = 0;
            }// TODO add your handling code here:
            else {
                if (sum < nbarcos) {
                    if (matriz[0][2] == 0) {
                        jButton3.setIcon(imgs[2]);

                        sum = sum + 1;
                        matriz[0][2] = 1;
                    }
                }
            }
        }
    }//GEN-LAST:event_jButton3MouseClicked

    private void jButton4MouseClicked(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_jButton4MouseClicked
        if (Estado == 'I') {
            if (matriz[0][3] == 1) {
                jButton4.setIcon(imgs[0]);
                sum = sum - 1;
                matriz[0][3] = 0;
            }// TODO add your handling code here:
            else {
                if (sum < nbarcos) {
                    if (matriz[0][3] == 0) {
                        jButton4.setIcon(imgs[2]);

                        sum = sum + 1;
                        matriz[0][3] = 1;
                    }
                }
            }
        }
    }//GEN-LAST:event_jButton4MouseClicked

    private void jButton5MouseClicked(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_jButton5MouseClicked
        if (Estado == 'I') {
            if (matriz[0][4] == 1) {
                jButton5.setIcon(imgs[0]);
                sum = sum - 1;
                matriz[0][4] = 0;
            }// TODO add your handling code here:
            else {
                if (sum < nbarcos) {
                    if (matriz[0][4] == 0) {
                        jButton5.setIcon(imgs[2]);

                        sum = sum + 1;
                        matriz[0][4] = 1;
                    }
                }
            }
        }
    }//GEN-LAST:event_jButton5MouseClicked

    private void jButton6MouseClicked(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_jButton6MouseClicked
        if (Estado == 'I') {
            if (matriz[1][0] == 1) {
                jButton6.setIcon(imgs[0]);

                sum = sum - 1;
                matriz[1][0] = 0;
            }// TODO add your handling code here:
            else {
                if (sum < nbarcos) {
                    if (matriz[1][0] == 0) {
                        jButton6.setIcon(imgs[2]);

                        sum = sum + 1;
                        matriz[1][0] = 1;
                    }
                }
            }
        }
    }//GEN-LAST:event_jButton6MouseClicked

    private void jButton7MouseClicked(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_jButton7MouseClicked
        if (Estado == 'I') {
            if (matriz[1][1] == 1) {
                jButton7.setIcon(imgs[0]);

                sum = sum - 1;
                matriz[1][1] = 0;
            }// TODO add your handling code here:
            else {
                if (sum < nbarcos) {
                    if (matriz[1][1] == 0) {
                        jButton7.setIcon(imgs[2]);

                        sum = sum + 1;
                        matriz[1][1] = 1;
                    }
                }
            }
        }
    }//GEN-LAST:event_jButton7MouseClicked

    private void jButton8MouseClicked(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_jButton8MouseClicked
        if (Estado == 'I') {
            if (matriz[1][2] == 1) {
                jButton8.setIcon(imgs[0]);

                sum = sum - 1;
                matriz[1][2] = 0;
            }// TODO add your handling code here:
            else {
                if (sum < nbarcos) {
                    if (matriz[1][2] == 0) {
                        jButton8.setIcon(imgs[2]);

                        sum = sum + 1;
                        matriz[1][2] = 1;
                    }
                }
            }
        }
    }//GEN-LAST:event_jButton8MouseClicked

    private void jButton9MouseClicked(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_jButton9MouseClicked
        if (Estado == 'I') {
            if (matriz[1][3] == 1) {
                jButton9.setIcon(imgs[0]);

                sum = sum - 1;
                matriz[1][3] = 0;
            }// TODO add your handling code here:
            else {
                if (sum < nbarcos) {
                    if (matriz[1][3] == 0) {
                        jButton9.setIcon(imgs[2]);

                        sum = sum + 1;
                        matriz[1][3] = 1;
                    }
                }
            }
        }
    }//GEN-LAST:event_jButton9MouseClicked

    private void jButton10MouseClicked(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_jButton10MouseClicked
        if (Estado == 'I') {
            if (matriz[1][4] == 1) {
                jButton10.setIcon(imgs[0]);

                sum = sum - 1;
                matriz[1][4] = 0;
            }// TODO add your handling code here:
            else {
                if (sum < nbarcos) {
                    if (matriz[1][4] == 0) {
                        jButton10.setIcon(imgs[2]);

                        sum = sum + 1;
                        matriz[1][4] = 1;
                    }
                }
            }
        }
    }//GEN-LAST:event_jButton10MouseClicked

    private void jButton11MouseClicked(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_jButton11MouseClicked
        if (Estado == 'I') {
            if (matriz[2][0] == 1) {
                jButton11.setIcon(imgs[0]);

                sum = sum - 1;
                matriz[2][0] = 0;
            }// TODO add your handling code here:
            else {
                if (sum < nbarcos) {
                    if (matriz[2][0] == 0) {
                        jButton11.setIcon(imgs[2]);

                        sum = sum + 1;
                        matriz[2][0] = 1;
                    }
                }
            }
        }
    }//GEN-LAST:event_jButton11MouseClicked

    private void jButton12MouseClicked(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_jButton12MouseClicked
        if (Estado == 'I') {
            if (matriz[2][1] == 1) {
                jButton12.setIcon(imgs[0]);

                sum = sum - 1;
                matriz[2][1] = 0;
            }// TODO add your handling code here:
            else {
                if (sum < nbarcos) {
                    if (matriz[2][1] == 0) {
                        jButton12.setIcon(imgs[2]);

                        sum = sum + 1;
                        matriz[2][1] = 1;
                    }
                }
            }
        }
    }//GEN-LAST:event_jButton12MouseClicked

    private void jButton13MouseClicked(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_jButton13MouseClicked
        if (Estado == 'I') {
            if (matriz[2][2] == 1) {
                jButton13.setIcon(imgs[0]);

                sum = sum - 1;
                matriz[2][2] = 0;
            }// TODO add your handling code here:
            else {
                if (sum < nbarcos) {
                    if (matriz[2][2] == 0) {
                        jButton13.setIcon(imgs[2]);

                        sum = sum + 1;
                        matriz[2][2] = 1;
                    }
                }
            }
        }
    }//GEN-LAST:event_jButton13MouseClicked

    private void jButton14MouseClicked(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_jButton14MouseClicked
        if (Estado == 'I') {
            if (matriz[2][3] == 1) {
                jButton14.setIcon(imgs[0]);

                sum = sum - 1;
                matriz[2][3] = 0;
            }// TODO add your handling code here:
            else {
                if (sum < nbarcos) {
                    if (matriz[2][3] == 0) {
                        jButton14.setIcon(imgs[2]);

                        sum = sum + 1;
                        matriz[2][3] = 1;
                    }
                }
            }
        }
    }//GEN-LAST:event_jButton14MouseClicked

    private void jButton15MouseClicked(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_jButton15MouseClicked
        if (Estado == 'I') {
            if (matriz[2][4] == 1) {
                jButton15.setIcon(imgs[0]);

                sum = sum - 1;
                matriz[2][4] = 0;
            }// TODO add your handling code here:
            else {
                if (sum < nbarcos) {
                    if (matriz[2][4] == 0) {
                        jButton15.setIcon(imgs[2]);

                        sum = sum + 1;
                        matriz[2][4] = 1;
                    }
                }
            }
        }
    }//GEN-LAST:event_jButton15MouseClicked

    private void jButton16MouseClicked(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_jButton16MouseClicked
        if (Estado == 'I') {
            if (matriz[3][0] == 1) {
                jButton16.setIcon(imgs[0]);

                sum = sum - 1;
                matriz[3][0] = 0;
            }// TODO add your handling code here:
            else {
                if (sum < nbarcos) {
                    if (matriz[3][0] == 0) {
                        jButton16.setIcon(imgs[2]);

                        sum = sum + 1;
                        matriz[3][0] = 1;
                    }
                }
            }
        }
    }//GEN-LAST:event_jButton16MouseClicked

    private void jButton17MouseClicked(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_jButton17MouseClicked
        if (Estado == 'I') {
            if (matriz[3][1] == 1) {
                jButton17.setIcon(imgs[0]);

                sum = sum - 1;
                matriz[3][1] = 0;
            }// TODO add your handling code here:
            else {
                if (sum < nbarcos) {
                    if (matriz[3][1] == 0) {
                        jButton17.setIcon(imgs[2]);

                        sum = sum + 1;
                        matriz[3][1] = 1;
                    }
                }
            }
        }
    }//GEN-LAST:event_jButton17MouseClicked

    private void jButton18MouseClicked(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_jButton18MouseClicked
        if (Estado == 'I') {
            if (matriz[3][2] == 1) {
                jButton18.setIcon(imgs[0]);

                sum = sum - 1;
                matriz[3][2] = 0;
            }// TODO add your handling code here:
            else {
                if (sum < nbarcos) {
                    if (matriz[3][2] == 0) {
                        jButton18.setIcon(imgs[2]);

                        sum = sum + 1;
                        matriz[3][2] = 1;
                    }
                }
            }
        }
    }//GEN-LAST:event_jButton18MouseClicked

    private void jButton19MouseClicked(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_jButton19MouseClicked
        if (Estado == 'I') {
            if (matriz[3][3] == 1) {
                jButton19.setIcon(imgs[0]);

                sum = sum - 1;
                matriz[3][3] = 0;
            }// TODO add your handling code here:
            else {
                if (sum < nbarcos) {
                    if (matriz[3][3] == 0) {
                        jButton19.setIcon(imgs[2]);

                        sum = sum + 1;
                        matriz[3][3] = 1;
                    }
                }
            }
        }
    }//GEN-LAST:event_jButton19MouseClicked

    private void jButton20MouseClicked(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_jButton20MouseClicked
        if (Estado == 'I') {
            if (matriz[3][4] == 1) {
                jButton20.setIcon(imgs[0]);

                sum = sum - 1;
                matriz[3][4] = 0;
            }// TODO add your handling code here:
            else {
                if (sum < nbarcos) {
                    if (matriz[3][4] == 0) {
                        jButton20.setIcon(imgs[2]);

                        sum = sum + 1;
                        matriz[3][4] = 1;
                    }
                }
            }
        }
    }//GEN-LAST:event_jButton20MouseClicked

    private void jButton21MouseClicked(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_jButton21MouseClicked
        if (Estado == 'I') {
            if (matriz[4][0] == 1) {
                jButton21.setIcon(imgs[0]);

                sum = sum - 1;
                matriz[4][0] = 0;
            }// TODO add your handling code here:
            else {
                if (sum < nbarcos) {
                    if (matriz[4][0] == 0) {
                        jButton21.setIcon(imgs[2]);

                        sum = sum + 1;
                        matriz[4][0] = 1;
                    }
                }
            }
        }
    }//GEN-LAST:event_jButton21MouseClicked

    private void jButton22MouseClicked(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_jButton22MouseClicked
        if (Estado == 'I') {
            if (matriz[4][1] == 1) {
                jButton22.setIcon(imgs[0]);

                sum = sum - 1;
                matriz[4][1] = 0;
            }// TODO add your handling code here:
            else {
                if (sum < nbarcos) {
                    if (matriz[4][1] == 0) {
                        jButton22.setIcon(imgs[2]);

                        sum = sum + 1;
                        matriz[4][1] = 1;
                    }
                }
            }
        }
    }//GEN-LAST:event_jButton22MouseClicked

    private void jButton23MouseClicked(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_jButton23MouseClicked
        if (Estado == 'I') {
            if (matriz[4][2] == 1) {
                jButton23.setIcon(imgs[0]);

                sum = sum - 1;
                matriz[4][2] = 0;
            }// TODO add your handling code here:
            else {
                if (sum < nbarcos) {
                    if (matriz[4][2] == 0) {
                        jButton23.setIcon(imgs[2]);

                        sum = sum + 1;
                        matriz[4][2] = 1;
                    }
                }
            }
        }
    }//GEN-LAST:event_jButton23MouseClicked

    private void jButton24MouseClicked(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_jButton24MouseClicked
        if (Estado == 'I') {
            if (matriz[4][3] == 1) {
                jButton24.setIcon(imgs[0]);

                sum = sum - 1;
                matriz[4][3] = 0;
            }// TODO add your handling code here:
            else {
                if (sum < nbarcos) {
                    if (matriz[4][3] == 0) {
                        jButton24.setIcon(imgs[2]);

                        sum = sum + 1;
                        matriz[4][3] = 1;
                    }
                }
            }
        }
    }//GEN-LAST:event_jButton24MouseClicked

    private void jButton25MouseClicked(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_jButton25MouseClicked
        if (Estado == 'I') {
            if (matriz[4][4] == 1) {
                jButton25.setIcon(imgs[0]);

                sum = sum - 1;
                matriz[4][4] = 0;
            }// TODO add your handling code here:
            else {
                if (sum < nbarcos) {
                    if (matriz[4][4] == 0) {
                        jButton25.setIcon(imgs[2]);

                        sum = sum + 1;
                        matriz[4][4] = 1;
                    }
                }
            }
        }
    }//GEN-LAST:event_jButton25MouseClicked

    private void jButton26MouseClicked(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_jButton26MouseClicked
        // TODO add your handling code here:
        if (Estado == 'J') {
            jButton26.setIcon(imgs[1]);
            dispara("0:0|");
        }
    }//GEN-LAST:event_jButton26MouseClicked

    private void jButton27MouseClicked(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_jButton27MouseClicked
        // TODO add your handling code here:
        if (Estado == 'J') {
            jButton27.setIcon(imgs[1]);
            dispara("0:1|");
        }
    }//GEN-LAST:event_jButton27MouseClicked

    private void jButton28MouseClicked(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_jButton28MouseClicked
        // TODO add your handling code here:
        if (Estado == 'J') {
            jButton28.setIcon(imgs[1]);
            dispara("0:2|");
        }
    }//GEN-LAST:event_jButton28MouseClicked

    private void jButton29MouseClicked(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_jButton29MouseClicked
        // TODO add your handling code here:
        if (Estado == 'J') {
            jButton29.setIcon(imgs[1]);
            dispara("0:3|");
        }
    }//GEN-LAST:event_jButton29MouseClicked

    private void jButton30MouseClicked(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_jButton30MouseClicked
        // TODO add your handling code here:
        if (Estado == 'J') {
            jButton30.setIcon(imgs[1]);
            dispara("0:4|");

        }
    }//GEN-LAST:event_jButton30MouseClicked

    private void jButton31MouseClicked(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_jButton31MouseClicked
        // TODO add your handling code here:
        if (Estado == 'J') {
            jButton31.setIcon(imgs[1]);
            dispara("1:0|");

        }
    }//GEN-LAST:event_jButton31MouseClicked

    private void jButton32MouseClicked(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_jButton32MouseClicked
        // TODO add your handling code here:
        if (Estado == 'J') {
            jButton32.setIcon(imgs[1]);
            dispara("1:1|");

        }
    }//GEN-LAST:event_jButton32MouseClicked

    private void jButton33MouseClicked(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_jButton33MouseClicked
        // TODO add your handling code here:
        if (Estado == 'J') {
            jButton33.setIcon(imgs[1]);
            dispara("1:2|");

        }
    }//GEN-LAST:event_jButton33MouseClicked

    private void jButton34MouseClicked(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_jButton34MouseClicked
        // TODO add your handling code here:
        if (Estado == 'J') {
            jButton34.setIcon(imgs[1]);
            dispara("1:3|");

        }
    }//GEN-LAST:event_jButton34MouseClicked

    private void jButton35MouseClicked(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_jButton35MouseClicked
        // TODO add your handling code here:
        if (Estado == 'J') {
            jButton35.setIcon(imgs[1]);
            dispara("1:4|");

        }
    }//GEN-LAST:event_jButton35MouseClicked

    private void jButton36MouseClicked(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_jButton36MouseClicked
        // TODO add your handling code here:
        if (Estado == 'J') {
            jButton36.setIcon(imgs[1]);
            dispara("2:0|");

        }
    }//GEN-LAST:event_jButton36MouseClicked

    private void jButton37MouseClicked(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_jButton37MouseClicked
        // TODO add your handling code here:
        if (Estado == 'J') {
            jButton37.setIcon(imgs[1]);
            dispara("2:1|");

        }
    }//GEN-LAST:event_jButton37MouseClicked

    private void jButton38MouseClicked(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_jButton38MouseClicked
        // TODO add your handling code here:
        if (Estado == 'J') {
            jButton38.setIcon(imgs[1]);
            dispara("2:2|");

        }
    }//GEN-LAST:event_jButton38MouseClicked

    private void jButton39MouseClicked(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_jButton39MouseClicked
        // TODO add your handling code here:
        if (Estado == 'J') {
            jButton39.setIcon(imgs[1]);
            dispara("2:3|");

        }
    }//GEN-LAST:event_jButton39MouseClicked

    private void jButton40MouseClicked(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_jButton40MouseClicked
        // TODO add your handling code here:
        if (Estado == 'J') {
            jButton40.setIcon(imgs[1]);
            dispara("2:4|");

        }
    }//GEN-LAST:event_jButton40MouseClicked

    private void jButton41MouseClicked(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_jButton41MouseClicked
        // TODO add your handling code here:
        if (Estado == 'J') {
            jButton41.setIcon(imgs[1]);
            dispara("3:0|");

        }
    }//GEN-LAST:event_jButton41MouseClicked

    private void jButton42MouseClicked(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_jButton42MouseClicked
        // TODO add your handling code here:
        if (Estado == 'J') {
            jButton42.setIcon(imgs[1]);
            dispara("3:1|");

        }
    }//GEN-LAST:event_jButton42MouseClicked

    private void jButton43MouseClicked(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_jButton43MouseClicked
        // TODO add your handling code here:
        if (Estado == 'J') {
            jButton43.setIcon(imgs[1]);
            dispara("3:2|");

        }
    }//GEN-LAST:event_jButton43MouseClicked

    private void jButton44MouseClicked(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_jButton44MouseClicked
        // TODO add your handling code here:
        if (Estado == 'J') {
            jButton44.setIcon(imgs[1]);
            dispara("3:3|");

        }
    }//GEN-LAST:event_jButton44MouseClicked

    private void jButton45MouseClicked(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_jButton45MouseClicked
        // TODO add your handling code here:
        if (Estado == 'J') {
            jButton45.setIcon(imgs[1]);
            dispara("3:4|");

        }
    }//GEN-LAST:event_jButton45MouseClicked

    private void jButton46MouseClicked(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_jButton46MouseClicked
        // TODO add your handling code here:
        if (Estado == 'J') {
            jButton46.setIcon(imgs[1]);
            dispara("4:0|");

        }
    }//GEN-LAST:event_jButton46MouseClicked

    private void jButton47MouseClicked(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_jButton47MouseClicked
        // TODO add your handling code here:
        if (Estado == 'J') {
            jButton47.setIcon(imgs[1]);
            dispara("4:1|");

        }
    }//GEN-LAST:event_jButton47MouseClicked

    private void jButton48MouseClicked(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_jButton48MouseClicked
        // TODO add your handling code here:
        if (Estado == 'J') {
            jButton48.setIcon(imgs[1]);
            dispara("4:2|");

        }
    }//GEN-LAST:event_jButton48MouseClicked

    private void jButton49MouseClicked(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_jButton49MouseClicked
        // TODO add your handling code here:
        if (Estado == 'J') {
            jButton49.setIcon(imgs[1]);
            dispara("4:3|");

        }
    }//GEN-LAST:event_jButton49MouseClicked

    private void jButton50MouseClicked(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_jButton50MouseClicked
        // TODO add your handling code here:
        if (Estado == 'J') {
            jButton50.setIcon(imgs[1]);
            dispara("4:4|");

        }
    }//GEN-LAST:event_jButton50MouseClicked

    private void jButton51MouseClicked(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_jButton51MouseClicked
        Estado = 'J';
    // TODO add your handling code here:
    }//GEN-LAST:event_jButton51MouseClicked

    public void dispara(String tiro) {
        int z = 0;
        c.enviar(direc, tiro);
        String quedan = c.recibir();
        z = quedan.length();
        quedan = quedan.substring(0, z - 1);
        int t = Integer.parseInt(quedan);
        if (t == 0) {
            JOptionPane.showMessageDialog(mainPanel, "Ganaste", "Win", JOptionPane.INFORMATION_MESSAGE);
        }
        String bala = c.recibir();
        z = bala.length();
        bala = bala.substring(0, z - 1);
        colorea(bala);
        String[] num = bala.split(":");
        int a = Integer.parseInt(num[0]);
        int b = Integer.parseInt(num[1]);
        if (matriz[a][b] == 1) {
            sum = sum - 1;
        }
        if (sum == 0) {
            JOptionPane.showMessageDialog(mainPanel, "Perdiste", "Lose", JOptionPane.INFORMATION_MESSAGE);
        }
        String rest = String.valueOf(sum);
        rest = rest + "|";
        c.enviar(direc, rest);
    }

    public void colorea(String color) {
        if (color.equals("0:0")) {
            jButton1.setIcon(imgs[1]);
        }
        if (color.equals("0:1")) {
            jButton2.setIcon(imgs[1]);
        }
        if (color.equals("0:2")) {
            jButton3.setIcon(imgs[1]);
        }
        if (color.equals("0:3")) {
            jButton4.setIcon(imgs[1]);
        }
        if (color.equals("0:4")) {
            jButton5.setIcon(imgs[1]);
        }
        if (color.equals("1:0")) {
            jButton6.setIcon(imgs[1]);
        }
        if (color.equals("1:1")) {
            jButton7.setIcon(imgs[1]);
        }
        if (color.equals("1:2")) {
            jButton8.setIcon(imgs[1]);
        }
        if (color.equals("1:3")) {
            jButton9.setIcon(imgs[1]);
        }
        if (color.equals("1:4")) {
            jButton10.setIcon(imgs[1]);
        }
        if (color.equals("2:0")) {
            jButton11.setIcon(imgs[1]);
        }
        if (color.equals("2:1")) {
            jButton12.setIcon(imgs[1]);
        }
        if (color.equals("2:2")) {
            jButton13.setIcon(imgs[1]);
        }
        if (color.equals("2:3")) {
            jButton14.setIcon(imgs[1]);
        }
        if (color.equals("2:4")) {
            jButton15.setIcon(imgs[1]);
        }
        if (color.equals("3:0")) {
            jButton16.setIcon(imgs[1]);
        }
        if (color.equals("3:1")) {
            jButton17.setIcon(imgs[1]);
        }
        if (color.equals("3:2")) {
            jButton18.setIcon(imgs[1]);
        }
        if (color.equals("3:3")) {
            jButton19.setIcon(imgs[1]);
        }
        if (color.equals("3:4")) {
            jButton20.setIcon(imgs[1]);
        }
        if (color.equals("4:0")) {
            jButton21.setIcon(imgs[1]);
        }
        if (color.equals("4:1")) {
            jButton22.setIcon(imgs[1]);
        }
        if (color.equals("4:2")) {
            jButton23.setIcon(imgs[1]);
        }
        if (color.equals("4:3")) {
            jButton24.setIcon(imgs[1]);
        }
        if (color.equals("4:4")) {
            jButton25.setIcon(imgs[1]);
        }
    }

    // Variables declaration - do not modify//GEN-BEGIN:variables
    private javax.swing.JButton jButton1;
    private javax.swing.JButton jButton10;
    private javax.swing.JButton jButton11;
    private javax.swing.JButton jButton12;
    private javax.swing.JButton jButton13;
    private javax.swing.JButton jButton14;
    private javax.swing.JButton jButton15;
    private javax.swing.JButton jButton16;
    private javax.swing.JButton jButton17;
    private javax.swing.JButton jButton18;
    private javax.swing.JButton jButton19;
    private javax.swing.JButton jButton2;
    private javax.swing.JButton jButton20;
    private javax.swing.JButton jButton21;
    private javax.swing.JButton jButton22;
    private javax.swing.JButton jButton23;
    private javax.swing.JButton jButton24;
    private javax.swing.JButton jButton25;
    private javax.swing.JButton jButton26;
    private javax.swing.JButton jButton27;
    private javax.swing.JButton jButton28;
    private javax.swing.JButton jButton29;
    private javax.swing.JButton jButton3;
    private javax.swing.JButton jButton30;
    private javax.swing.JButton jButton31;
    private javax.swing.JButton jButton32;
    private javax.swing.JButton jButton33;
    private javax.swing.JButton jButton34;
    private javax.swing.JButton jButton35;
    private javax.swing.JButton jButton36;
    private javax.swing.JButton jButton37;
    private javax.swing.JButton jButton38;
    private javax.swing.JButton jButton39;
    private javax.swing.JButton jButton4;
    private javax.swing.JButton jButton40;
    private javax.swing.JButton jButton41;
    private javax.swing.JButton jButton42;
    private javax.swing.JButton jButton43;
    private javax.swing.JButton jButton44;
    private javax.swing.JButton jButton45;
    private javax.swing.JButton jButton46;
    private javax.swing.JButton jButton47;
    private javax.swing.JButton jButton48;
    private javax.swing.JButton jButton49;
    private javax.swing.JButton jButton5;
    private javax.swing.JButton jButton50;
    private javax.swing.JButton jButton51;
    private javax.swing.JButton jButton6;
    private javax.swing.JButton jButton7;
    private javax.swing.JButton jButton8;
    private javax.swing.JButton jButton9;
    private javax.swing.JLabel jLabel1;
    private javax.swing.JPanel jPanel1;
    private javax.swing.JPanel jPanel2;
    private javax.swing.JPanel mainPanel;
    private javax.swing.JMenuBar menuBar;
    private javax.swing.JProgressBar progressBar;
    private javax.swing.JLabel statusAnimationLabel;
    private javax.swing.JLabel statusMessageLabel;
    private javax.swing.JPanel statusPanel;
    // End of variables declaration//GEN-END:variables
    private final Timer messageTimer;
    private final Timer busyIconTimer;
    private final Icon idleIcon;
    private final Icon[] busyIcons = new Icon[15];
    private int busyIconIndex = 0;
    private JDialog aboutBox;
}
